package com.wiz.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.wiz.mapper.FuelingMapper;
import com.wiz.service.FuelingService;
import com.wiz.to.FuelingTO;
import com.wiz.vo.criteria.FuelingSearchCriteriaTO;

@Service("fuelingService")
public class FuelingServiceImpl implements FuelingService {
	private Gson gson = new GsonBuilder().disableHtmlEscaping().create();
	private transient final Logger log = LoggerFactory.getLogger(getClass());

	@Resource
	private FuelingMapper fuelingMapper;

	@Override
	public List<FuelingTO> getFuelingListByCriteriaTO(
			FuelingSearchCriteriaTO fuelingSearchCriteriaTO) {
		// TODO Auto-generated method stub
		return fuelingMapper.getFuelingListByCriteriaTO(fuelingSearchCriteriaTO);
	}

	@Override
	public int getFuelingCntByCriteriaTO(
			FuelingSearchCriteriaTO fuelingSearchCriteriaTO) {
		// TODO Auto-generated method stub
		return fuelingMapper.getFuelingCntByCriteriaTO(fuelingSearchCriteriaTO);
	}

	@Override
	public FuelingTO getFueling(String fuellingOrderId) {
		List<FuelingTO> list = fuelingMapper.getFueling(fuellingOrderId);
		if(list != null && list.size()>0){
			return list.get(0);
		}
		return null;
	}

	

	
}